import {Component} from '@angular/core';
import {IonicModule} from '@ionic/angular';

import {NgIf} from '@angular/common';
import {EmailComposer} from '@ionic-native/email-composer/ngx';
import {FormsModule} from '@angular/forms';

@Component({
  selector: 'send-mail',
  templateUrl: 'send-mail.page.html',
  styleUrls: ['send-mail.scss'],
  standalone: true,
  imports: [IonicModule, NgIf, FormsModule],
})
export class SendMainPage {
  to: string;
  subject: string;
  body: string;


  constructor(private emailComposer: EmailComposer) {
    this.to=""
    this.subject=""
    this.body=""
  }

  sendEmail() {
    let email = {
      to: this.to,
      cc: '',
      bcc: '',
      attachments: [],
      subject: this.subject,
      body: this.body,
      isHtml: true,
    };

    this.emailComposer.open(email);
  }


}
